/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package arbitration.logic.validator;

/**
 *
 * @author prophet
 */
public class CountValidator implements Validator{
    private final static int MAX_VALUE=10000;

    public Object isValid(String value) {
        String t=new String(value);
        if(t==null){
            return null;
        }
        t=t.trim();
        try{
            Integer i=Integer.parseInt(t);
            if (i <= 0||i>MAX_VALUE) {
                return null;
            } else {
                return i;
            }
        }catch(NumberFormatException ex){
            return null;
        }
    }

}
